<?php
include("dao/DatabaseDAO.php");
include("Security.php");

Security::checkAuthenticated();

$database = Array(
    "UserId" => $_SESSION["UserId"],
    "URL" => $_POST["databaseUrl"],
    "DatabaseName" => $_POST["databaseName"],
    "User" => $_POST["user"],
    "Password" => $_POST["password"],
);

//$database = Array(
//    "UserId" => '1',
//    "URL" => 'http://localhost',
//    "DatabaseName" => 'xml_to_mysql',
//    "User" => 'root',
//    "Password" => 'root',
//);

$databaseDAO = new DatabaseDAO();
$databaseDAO->saveDatabase($database);

header("location:../manage.php");
?>